5/29/98.  Driving 2-pole plant w/30ms delays, extra gains, etc.
          errlim=0.005;

>clear all
>help pgcalc

  PGcalc.m: Iteratively find the best(?) pulse amplitude to make a saccade.
  Usage: set up "pwtstbed" with the PG width function you wish to use.
  In the "Double Pulse" block set "Pulse 1 Magnitude" to "goal"
  and "Pulse 1 Duration" to "stoptime"
  Set up "testbed" with the plant you wish to use.  In the "Double Pulse"
  block, set "Pulse 1 Mag" to "stimhgt" and "Pulse 1 Dur" to "stimdur"
  "delay" is the value of the delay block (if one is used) in the plant model in secs.

 pgcalc

Enter the delay for the test plant (in seconds): 0.001

     goal      peak    PW (ms)    PH        tries    %error
    --------------------------------------------------------------
    0.1000    0.1049   13.0000    2.8984   61.0000    4.8939
    0.2000    0.2049   13.0000    5.6654   19.0000    2.4323
    0.3000    0.3049   13.0000    8.4334   11.0000    1.6226
    0.4000    0.4048   13.0000   11.2003    8.0000    1.2088
    0.5000    0.5048   13.0000   13.9685    6.0000    0.9694
    0.6000    0.6048   14.0000   14.8909   69.0000    0.8018
    0.7000    0.7050   14.0000   17.3572    3.0000    0.7080
    0.8000    0.8050   15.0000   17.8173   65.0000    0.6229
    0.9000    0.9048   16.0000   18.1622   60.0000    0.5363
    1.0000    1.0048   17.0000   18.4307   55.0000    0.4845
    1.1000    1.1048   17.0000   20.2639    2.0000    0.4331
    1.2000    1.2049   18.0000   20.3289   52.0000    0.4063
    1.3000    1.3050   18.0000   22.0180    1.0000    0.3822
    1.4000    1.4049   20.0000   20.3978   55.0000    0.3529
    1.5000    1.5049   20.0000   21.8499    1.0000    0.3286
    1.6000    1.6047   21.0000   21.7689   43.0000    0.2953
    1.7000    1.7048   22.0000   21.6971   40.0000    0.2831
    1.8000    1.8047   22.0000   22.9687    1.0000    0.2608
    1.9000    1.9049   23.0000   22.8296   38.0000    0.2569
    2.0000    2.0048   24.0000   22.7017   36.0000    0.2396
    3.0000    3.0049   26.0000   30.6479   42.0000    0.1640
    4.0000    4.0047   28.0000   37.1637   40.0000    0.1181
    5.0000    5.0045   30.0000   42.6175   38.0000    0.0894
    6.0000    6.0049   32.0000   47.2683   35.0000    0.0816
    7.0000    7.0048   34.0000   51.2884   33.0000    0.0691
    8.0000    8.0049   36.0000   54.8139   31.0000    0.0614
    9.0000    9.0043   38.0000   57.9385   30.0000    0.0483
   10.0000   10.0047   40.0000   60.7447   28.0000    0.0467
   11.0000   11.0043   42.0000   63.2812   27.0000    0.0392
   12.0000   12.0049   44.0000   65.6008   25.0000    0.0412
   13.0000   13.0048   46.0000   67.7304   24.0000    0.0368
   14.0000   14.0047   48.0000   69.7023   23.0000    0.0336
   15.0000   15.0047   50.0000   71.5393   22.0000    0.0315
   16.0000   16.0048   52.0000   73.2602   21.0000    0.0303
   17.0000   17.0039   54.0000   74.8765   21.0000    0.0230
   18.0000   18.0041   56.0000   76.4087   20.0000    0.0229
   19.0000   19.0044   58.0000   77.8637   19.0000    0.0234
   20.0000   20.0049   60.0000   79.2508   18.0000    0.0245
   21.0000   21.0041   62.0000   80.5737   18.0000    0.0194
   22.0000   22.0046   64.0000   81.8468   17.0000    0.0210
   23.0000   23.0039   66.0000   83.0684   17.0000    0.0169
   24.0000   24.0045   68.0000   84.2506   16.0000    0.0189
   25.0000   25.0039   70.0000   85.3907   16.0000    0.0154
   26.0000   26.0047   72.0000   86.4994   15.0000    0.0180
   27.0000   27.0040   74.0000   87.5731   15.0000    0.0148
   28.0000   28.0034   76.0000   88.6185   15.0000    0.0122
   29.0000   29.0043   78.0000   89.6410   14.0000    0.0149
   30.0000   30.0037   80.0000   90.6366   14.0000    0.0125
   31.0000   31.0049   82.0000   91.6140   13.0000    0.0158
   32.0000   32.0043   84.0000   92.5680   13.0000    0.0134
   33.0000   33.0037   86.0000   93.5042   13.0000    0.0113
   34.0000   34.0033   88.0000   94.4238   13.0000    0.0096
   35.0000   35.0045   90.0000   95.3310   12.0000    0.0128
   36.0000   36.0040   92.0000   96.2211   12.0000    0.0110
   37.0000   37.0035   94.0000   97.0984   12.0000    0.0095
   38.0000   38.0031   96.0000   97.9637   12.0000    0.0081
   39.0000   39.0045   98.0000   98.8208   11.0000    0.0115
   40.0000   40.0040  100.0000   99.6647   11.0000    0.0101
   41.0000   41.0036  102.0000  100.4992   11.0000    0.0087
   42.0000   42.0032  104.0000  101.3251   11.0000    0.0076
   43.0000   43.0049  106.0000  102.1457   10.0000    0.0114
   44.0000   44.0044  108.0000  102.9557   10.0000    0.0101
   45.0000   45.0040  110.0000  103.7588   10.0000    0.0089
   46.0000   46.0036  112.0000  104.5554   10.0000    0.0078
   47.0000   47.0033  114.0000  105.3462   10.0000    0.0069
   48.0000   48.0029  116.0000  106.1313   10.0000    0.0061
   49.0000   49.0049  118.0000  106.9140    9.0000    0.0099
   50.0000   50.0044  120.0000  107.6890    9.0000    0.0089

Elapsed time: 96.51 (Dell 200 MHz)